Test Series - Data Structure

Test Number 86/115

Q: What is the time complexity for increasing priority of key in a maximum ternary heap of n elements?
A. O (log n/ log 3)
B. O (n!)
C. O (n)
D. O (1)
Solution: In order to increase the priority of an item in a ternary heap data structure having n elements, it performs upwards swapping. So the time complexity for worst case is found to be O (log n/ log 3).
Q: What is the time complexity for deleting root key in a ternary heap of n elements?
A. O (log n/ log 3)
B. O (3log n/ log 3)
C. O (n)
D. O (1)
Solution: In order to delete a root key in a ternary heap data structure having n elements, it performs downward swapping. So the time complexity for worst case is found to be O (3log n/ log 3).
Q: What is the time complexity for increasing priority of key in a minimum ternary heap of n elements?
A. O (log n/ log 3)
B. O (3log n/ log 3)
C. O (n)
D. O (1)
Solution: In order to the increasing the priority of key in a minimum ternary heap data structure having n elements, it performs downward swapping. So the time complexity for worst case is found to be O (3log n/ log 3).
Q: What is the time complexity for decreasing priority of key in a maximum ternary heap of n elements?
A. O (log n/ log 3)
B. O (3log n/ log 3)
C. O (n)
D. O (1)
Solution: In order to decrease the priority of key in a maximum ternary heap data structure having n elements, it performs downward swapping. So the time complexity for worst case is found to be O (3log n/ log 3).
Q: Do ternary heap have better memory cache behavior than binary heap.
A. True
B. False
C. none
D. ...
Solution: Ternary heap is a type of data structure in the field of computer science. It is a part of the Heap data structure family. Due to the swapping process, they have better memory cache behavior.
Q: What is the time complexity for creating a ternary heap using swapping?
A. O (log n/ log 3)
B. O (n!)
C. O (n)
D. O (1)
Solution: Ternary Heap can be formed by two swapping operations. Therefore, the time complexity for creating a ternary heap using two swapping operation is found to be O (n).
Q: Which of the following is the application of minimum ternary heap?
A. Prim’s Algorithm
B. Euclid’s Algorithm
C. Eight Queen Puzzle
D. Tree
Solution: When working on the graph in the computer science field, the Prim’s Algorithm for spanning trees uses a minimum ternary heap as there are delete operation equal to a number of edges and decrease priority operation equal to the number of vertices associated with the graph.
Q: What is the reason for the efficiency of a pairing heap?
A. simplicity
B. time-efficient
C. space-efficient
D. advanced
Solution: The reason for the simplicity of a pairing heap is its simplicity as it is simpler and outperform other heap structures.
Q: How is a pairing heap represented?
A. binary tree
B. fibonacci tree
C. heap ordered tree
D. treap
Solution: A pairing heap is represented as a heap-ordered tree and the analysis of pairing heap is open.
Q: The actual pairing heap implementation uses the right child and left child representation.
A. true
B. false
C. none
D. ...
Solution: The actual pairing heap implementation uses a left child and right sibling representation since it follows heap order property.

You Have Score    /10